Under the root XML element, you can add <plugin-configuration> which follows the standard RHQ configuration schema. This will let you define configuration for any plugin. The configuration is stored in the plugin context.
Disabling Plugins When Configuration Changes
> When editing a plugin configuration of a server side plugin,
> the plugin is disabled (which I think is wrong anyway).
https://bugzilla.redhat.com/show_bug.cgi?id=548526
I'll explain why this is.
First, if you have only a single server (i.e. you are not using multiple RHQ Servers in an HA Server Cloud), then yes this is not needed - we should just reload the plugin in the same state it was in (if it was disabled, leave disabled; if enabled, leave enabled). In fact, that could be an enhancement we should make - if there is only one server in the RHQ_SERVER table, then we should not disable the plugin.
But - think about the case when there is 2 or more RHQ Servers in the HA Server Cloud. Let's go through an example.
I have 2 RHQ Servers, server #1 and server #2. Each, of course, has their own set of server-side plugins running in their own master plugin container. As with everything else in our homogenous design, these 2 RHQ Server master plugin containers are independent of one another - they don't directly talk to each other, they don't know each other exists.
I point my browser to server #1 and through its GUI, I change a server plugin's configuration, persisting the change to the database. Server #1 knows the change was made - because I made the change through its GUI. So Server #1 knows enough to tell its master plugin container that it needs to reload the plugin whose configuration changed. BUT! How does server #2 know that this plugin's configuration changed? How does it need to know that it must get its master plugin container to reload the plugin? There is no way today for this to happen, short of the servers to periodically poll the database.
How do we solve this today? When a server changes a plugin configuration (like I did on server #1 in the above example), the server will disable the plugin. By default, all servers check into the database every 5 minutes to see if a plugin state changed (enabled->disabled, or disabled->enabled) and reloads the plugins as appropriate (see org.rhq.enterprise.server.core.plugin.ServerPluginScanner.registerServerPlugins()). So, in effect, this change to the disabled state IS the communication from one server to all others in the HA Server - its how one server lets the others know that they need to reload the plugin because its configuration changed.
This is not a good solution because it means to be absolutely sure all servers pick up a config change, the user must not re-enable a plugin for at least 5 minutes after a plugin config change was made. What we need to do is have each server periodically poll the plugin configuration as seen in the database and if a change has been detected, then it should reload its plugin (this would allow the state to remain as-is since the state value will not be used as the "change marker".